#include <iostream>
#include<vector>
using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    vector<double> a(n);
    vector<double> b(n);
    for (int i = 0;i < n;i++)
    {
        cin >> a[i];
    }
    for (int i = 0;i < n;i++)
    {
        cin >> b[i];
    }
    vector<vector<double>> dp(n, vector<double>(2));
    for (int i = n - 1;i >= n - k;i--)
    {
        dp[n - k][0] += a[i];
        dp[n - k][1] += b[i];
    }

    for (int i = n - k - 1;i >= 0;i--)
    {
        dp[i][0] = dp[i + 1][0] - a[i + k] + a[i];
        dp[i][1] = dp[i + 1][1] - b[i + k] + b[i];
        // cout<<dp[i][0]<<" "<<dp[i][1]<<endl;
    }
    int index = 0;
    for (int i = 1;i <= n - k;i++)
    {
        if (dp[i][0] > dp[index][0])
        {
            index = i;
        }
        else if (dp[i][0] == dp[index][0] && dp[i][1] < dp[index][1])
        {
            index = i;
        }
    }
    cout << index + 1;



    return 0;

}